package org.tao.lightningmq.broker.model;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author lht
 * @date 2025/1/4 - 21:51
 * @description:
 */
public class ConsumeQueueOffsetModel {

    private final OffsetTable offsetTable = new OffsetTable();

    public static class OffsetTable {
        /**
         * key: topic名称
         */
        private final Map<String, ConsumerGroupDetail> topicConsumerGroupDetail = new HashMap<>();

        public Map<String, ConsumerGroupDetail> getTopicConsumerGroupDetail() {
            return topicConsumerGroupDetail;
        }
    }

    public static class ConsumerGroupDetail {
        /**
         * key: consumerGroup名称
         * value: key: n号队列, value: commitlog@offset
         */
        private final Map<String, Map<String, String>> consumerGroupDetailMap = new HashMap<>();

        public Map<String, Map<String, String>> getConsumerGroupDetailMap() {
            return consumerGroupDetailMap;
        }
    }

    public OffsetTable getOffsetTable() {
        return offsetTable;
    }
}
